package com.prism.cluster;

import java.io.FileNotFoundException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Random;

import javax.swing.event.ListSelectionEvent;

import com.prism.moodme.data.Data;
import com.prism.moodme.datastore.AccessDataStore;

import com.prism.moodme.util.DisplayUtility;
import com.prism.moodme.util.Utility;

public class test {

	/**
	 * @param args
	 *
	 */
	public static String path = "F:\\timeStamp";
	public static void main(String[] args) {

		ArrayList<String> points = Utility.readContent(path);
//		System.out.println(Utility.getTime(Long.parseLong("1311168036292")).getTime());
//		long timeStamp = Long.parseLong("1310995244275");

//		try {
////			AccessDataStore.cleanupAll();
////			ArrayList<Data> data = AccessDataStore.getData("1", 1);
////			for(Data dat : data)
////				System.out.println(dat.getCalendar().getTime());
//		} catch (SQLException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}
//		catch (FileNotFoundException e) {
//			// TODO Auto-generated catch block
//			e.printStackTrace();
//		}

//		System.out.println(data);
//		Cluster clust = new Cluster(data);
//		ClusterSet clust = new ClusterSet(13, data);
//
//		KayMeans kay = new KayMeans(clust);
//		System.out.println(kay);



//		System.out.println(DisplayUtility.getDayChartURL(data.subList(0, 100), 400, 400));
//		System.out.println(DisplayUtility.getTimeChartURL(data.subList(0, 100), 400, 400));
//		System.out.println(DisplayUtility.getMapURL(data.subList(0, 100), 400, 400));


//		List<String> day, hour;
//		List<Integer>month = new ArrayList<Integer>();
//		for(int i=4; i<5; i++)
//			month.add(i);
//
//		day = Arrays.asList(Utility._DAYS).subList(1,Utility._DAYS.length - 10);
//		hour = Arrays.asList(Utility._HOURS).subList(1,Utility._HOURS.length);
//
//
//		Calendar calendar;
//
//
//		Random random = new Random(System.currentTimeMillis());
//		for(String curr : points){
//			long timeStamp = Long.parseLong(curr);
//			calendar = Utility.getTime(timeStamp);
//			calendar.set(1, 2011);
//			int mm = 3;
//			int dd = Integer.parseInt(day.get(random.nextInt(day.size())));
//			calendar.set(2011, mm, dd);
//
//
//			int min = calendar.get(Calendar.MINUTE);
//			if(min % 5 != 0){
//				int mod = (int)min/5;
//				min = mod * 5;
//				calendar.set(Calendar.MINUTE, min);
//
//			}
//			calendar.set(Calendar.SECOND, 0);
//			calendar.set(Calendar.MILLISECOND, 0);
//			System.out.println(calendar.getTimeInMillis());
////			System.out.println(calendar.get(Calendar.YEAR)+"\t"+calendar.get(Calendar.MONTH)+"\t"+calendar.get(Calendar.DAY_OF_MONTH)+"\t"+calendar.get(Calendar.HOUR_OF_DAY)+"\t"+calendar.get(Calendar.MINUTE));
//		}

//		for(int i=0; i<1000; i++){
//			int mm = month.get(new Random(System.currentTimeMillis()).nextInt(month.size()));
//			int dd = Integer.parseInt(day.get(new Random(System.currentTimeMillis()).nextInt(day.size())));
//
//			int[] timeStamp = new int[]{};
//		}
//		System.out.println(month);
//		System.out.println(day);
//		System.out.println(hour);
	}

}
